:: 启动aria2c, 获取启动参数并传给ara2c
chcp 65001
set allParam=
goto param
:: @author mmbro
:: @since 2023-12-31 13:23:17
:: @see <a href="https://blog.csdn.net/tsvico/article/details/78050884">win7/10中以管理员身份运行bat脚本时，获取当前文件所在目录</a>

:: 获取所有参数
:: @see <a href="https://blog.csdn.net/sheji105/article/details/89011826">bat获取所有的参数</a>
:param
@echo off
shift /0
set str=%0
echo %str%
if "%str%"=="" (
    goto start
)
set allParam=%allParam% %str%
goto param
goto end

:start
@echo off
set oldPath=%cd%
set aria2cPath=D:\soft\aria2c\aria2c.exe
title "正在启动Aria2c, 路径[%aria2cPath%], 参数[%allParam%]"
cd /d %~dp0
echo %aria2cPath%%allParam%
%aria2cPath%%allParam%


goto restorePath
:: 返回运行本脚本之前的目录
:restorePath
cd /d %oldPath%

:end